<?php

namespace Admin\Enum;

/**
 * 行为类型
 */
class ActionType
{
    const SYS = 1;
    
    const USER = 2;
    
    protected static $types = [
        self::SYS => '系统',
        self::USER => '用户'
    ];

    /**
     * 
     * @return array 所有
     */
    public static function all()
    {
        return self::$types;
    }
    
    /**
     * 获取对应类型的标签
     * @param int $type
     * @return string
     */
    public static function label($type)
    {
        return isset(self::$types[$type])
                ? self::$types[$type]
                : '';
    }
}

